From cafaaae3a2a99bb9f5530153adc96f63e303c7c1 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Thu, 15 Aug 2013 17:40:20 +0000 Subject: [PATCH] NEWQ scribbling in filters. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4534 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/arcdist.cc | 9 ++++++++- gpsbabel/polygon.cc | 9 ++++++++- gpsbabel/radius.cc | 9 +++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gpsbabel/arcdist.cc b/gpsbabel/arcdist.cc index 8456a91bb..12a93393b 100644 --- a/gpsbabel/arcdist.cc +++ b/gpsbabel/arcdist.cc @@ -92,9 +92,12 @@ arcdist_arc_disp_wpt_cb(const waypoint *arcpt2) if (arcpt2 && arcpt2->latitude != BADVAL && arcpt2->longitude != BADVAL && (ptsopt || (arcpt1 && (arcpt1->latitude != BADVAL && arcpt1->longitude != BADVAL)))) { +#if NEWQ + foreach(waypoint* waypointp, waypt_list) { +#else QUEUE_FOR_EACH(&waypt_head, elem, tmp) { - waypointp = (waypoint*) elem; +#endif if (waypointp->extra_data) { ed = (extra_data*) waypointp->extra_data; } else { @@ -204,8 +207,12 @@ arcdist_process(void) } removed = 0; +#if NEWQ + foreach(waypoint* wp, waypt_list) { +#else QUEUE_FOR_EACH(&waypt_head, elem, tmp) { waypoint* wp = (waypoint*) elem; +#endif extra_data* ed; ed = (extra_data*) wp->extra_data; wp->extra_data = NULL; diff --git a/gpsbabel/polygon.cc b/gpsbabel/polygon.cc index 7ec0acbde..700f2257c 100644 --- a/gpsbabel/polygon.cc +++ b/gpsbabel/polygon.cc @@ -269,9 +269,12 @@ polygon_process(void) fileline); } else if (lat1 != BADVAL && lon1 != BADVAL && lat2 != BADVAL && lon2 != BADVAL) { +#if NEWQ + foreach(waypoint* waypointp, waypt_list) { +#else QUEUE_FOR_EACH(&waypt_head, elem, tmp) { - waypointp = (waypoint *)elem; +#endif if (waypointp->extra_data) { ed = (extra_data *) waypointp->extra_data; } else { @@ -315,8 +318,12 @@ polygon_process(void) } gbfclose(file_in); +#if NEWQ + foreach(waypoint* wp, waypt_list) { +#else QUEUE_FOR_EACH(&waypt_head, elem, tmp) { waypoint *wp = (waypoint *) elem; +#endif ed = (extra_data *) wp->extra_data; wp->extra_data = NULL; if (ed) { diff --git a/gpsbabel/radius.cc b/gpsbabel/radius.cc index dde26d064..941edc92d 100644 --- a/gpsbabel/radius.cc +++ b/gpsbabel/radius.cc @@ -116,11 +116,12 @@ radius_process(void) int i, wc; queue temp_head; route_head *rte_head = NULL; - +#if NEWQ + foreach(waypoint* waypointp, waypt_list) { +#else QUEUE_FOR_EACH(&waypt_head, elem, tmp) { - extra_data *ed; - waypointp = (waypoint *)elem; +#endif dist = gc_distance(waypointp->latitude, waypointp->longitude, home_pos->latitude, @@ -135,7 +136,7 @@ radius_process(void) continue; } - ed = (extra_data *) xcalloc(1, sizeof(*ed)); + extra_data *ed = (extra_data *) xcalloc(1, sizeof(*ed)); ed->distance = dist; waypointp->extra_data = ed; } -- 2.30.2